manifest {
  nextflowVersion = '!>=20.12.1-edge'
}

// ADAPT rootDir ACCORDING TO RELATIVE PATH WITHIN PROJECT
params {
  rootDir = "$projectDir/../../../.."
}

def viash_temp = System.getenv("VIASH_TEMP") ?: "/tmp/"
def rootDir = java.nio.file.Paths.get(params.rootDir).toAbsolutePath().normalize().toString()
srcDir = "$rootDir/src"
targetDir = "$rootDir/target/nextflow"

// includeConfig "$targetDir/match_modality_methods/baseline_babel_knn/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_dr_knnr_knn/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_dr_knnr_cbf/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_newwave_knnr_cbf/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_newwave_knnr_knn/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_procrustes_knn/nextflow.config"
includeConfig "$targetDir/match_modality_methods/baseline_linear_knn/nextflow.config"
includeConfig "$targetDir/match_modality_methods/dummy_constant/nextflow.config"
includeConfig "$targetDir/match_modality_methods/dummy_random/nextflow.config"
includeConfig "$targetDir/match_modality_methods/dummy_solution/nextflow.config"
includeConfig "$targetDir/match_modality_methods/dummy_semisolution/nextflow.config"
includeConfig "$targetDir/match_modality_metrics/aupr/nextflow.config"
includeConfig "$targetDir/match_modality_metrics/match_probability/nextflow.config"
includeConfig "$targetDir/match_modality_metrics/check_format/nextflow.config"
includeConfig "$targetDir/match_modality_results/final_scores/nextflow.config"
includeConfig "$targetDir/common/bind_tsv_rows/nextflow.config"
includeConfig "$srcDir/common/workflows/resource_labels.config"

docker {
  runOptions = "-v $rootDir:$rootDir -v $viash_temp:$viash_temp --shm-size=4096m"
}

process {
  errorStrategy = 'ignore'
  container = 'nextflow/bash:latest'
}
